#pragma once

#ifndef _DROPLET_DATA_STRUCTS
#define _DROPLET_DATA_STRUCTS

#ifdef _WIN32
#include "inttypes.h"
#elif
#include <inttypes.h>	// inttypes.h is included in UNIX systems
#endif

#include "DropletSimGlobals.h"
#include "btBulletDynamicsCommon.h"

typedef struct _Simulator_Physics_Data
{
	// Bullet Physics Stuff
	btDefaultCollisionConfiguration		*collisionConfig;
	btCollisionDispatcher				*collisionDispatch;
	btBroadphaseInterface				*broadphase;
	btConstraintSolver					*constraintSolver;
	btDiscreteDynamicsWorld				*dynWorld;
	
	btAlignedObjectArray<btCollisionShape *> *collisionShapes;
	int _colShapeIDCounter, _physicsWorldObjCounter;

} SimPhysicsData;

typedef struct _Object_Physics_Data
{
	btScalar mass, friction;
	btVector3 localInertia;
	int colShapeIndex;	// Collsion Shape Index
	unsigned int _worldID; // Physics World ID. Set automatically by simulator.

} ObjectPhysicsData;

typedef struct _Droplet_Actuator_Data
{
	uint8_t rOut, gOut, bOut;
	float moveTimeRemaining, rotateTimeRemaining;	// in milliseconds
	move_direction currMoveDir;
	turn_direction currTurnDir;

} DropletActuatorData;

typedef struct _Droplet_Sensor_Data
{
	uint8_t rIn, gIn, bIn;	// Color being read by RGB sensor
	
} DropletSensorData;

typedef struct _Droplet_Communication_Data
{
	// TODO : Add Communication Data Here.
	char *msg;

} DropletCommData;

typedef struct _Droplet_Component_Data
{
	int8_t leg1Power, leg2Power, leg3Power;
	uint8_t capacitorPower;
	uint16_t dropletID; // Same as ObjectPhysicsData::_worldID

} DropletCompData;

#endif